/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2024-07-07     86188       the first version
 */
#ifndef APPLICATIONS_INC_UWB_H_
#define APPLICATIONS_INC_UWB_H_

#include <rtthread.h>
#include <board.h>
#include <stm32f4xx_hal.h>

extern uint8_t path_cnt;
extern uint8_t path_num;

extern float uwbRawDatax;
extern float uwbRawDatay;


void createUwbDeviceAndTask(void);
rt_err_t uwbCallback(rt_device_t dev, rt_size_t size);
void uwbRxProTask(void *parameter);
uint8_t uwbDataFilter(uint8_t dt);





/*

  start  --------1              A                  C
                 |              |                  |
                 |              |                  |
                 |              |                  |
                 2______________3__________________4
                 |
                 |
                 |
                 |
                 |
                 |
                 5______________6__________________7
                                |                  |
    x                           |                  |
    ^                           |                  |
    |                           B                  D
    |
    |
    ----> y

*/

enum POINTA      { POINTA_X = 75  , POINTA_Y = 300};
enum POINTB      { POINTB_X = 225 , POINTB_Y = 300};
enum POINTC      { POINTC_X = 75  , POINTC_Y = 360};
enum POINTD      { POINTD_X = 225 , POINTD_Y = 360};



enum START_POINT { START_POINT_X = 45      , START_POINT_Y = 200};

enum POINT1      { POINT1_X = START_POINT_X , POINT1_Y = 260};
enum POINT2      { POINT2_X = 100           , POINT2_Y = POINT1_Y};
enum POINT3      { POINT3_X = POINT2_X      , POINT3_Y = POINTA_Y};
enum POINT4      { POINT4_X = POINT2_X      , POINT4_Y = POINTC_Y};
enum POINT5      { POINT5_X = 192           , POINT5_Y = POINT1_Y};
enum POINT6      { POINT6_X = POINT5_X      , POINT6_Y = POINTB_Y};
enum POINT7      { POINT7_X = POINT5_X      , POINT7_Y = POINTD_Y};

#endif /* APPLICATIONS_INC_UWB_H_ */
